package com.spring.proxy;

/**
 * 静态代理
 */
public class BuyHouseProxy implements BuyHouse {

	private BuyHouse buyHouse;

	public BuyHouseProxy(final BuyHouse buyHouse) {
		this.buyHouse = buyHouse;
	}

	@Override
	public void buyHouse() {
		System.out.println("买房前");
		buyHouse.buyHouse();
		System.out.println("买房后");
	}

	public static void main(String[] args) {
		BuyHouse buyHouse = new BuyHouseImpl();
		buyHouse.buyHouse();
		System.out.println("==========");
		BuyHouse buyHouseProxy = new BuyHouseProxy(buyHouse);
		buyHouseProxy.buyHouse();
	}
}
